// 做数据的加密处理
// 输入：node encode.js jinshiyun 1234
var userName = process.argv[2]; //jinshiyun
var pwd = process.argv[3]; //1234
var str = "userName:" + userName + " pwd: " + pwd;
// console.log(str); //userName:jinshiyun pwd: 1234

var buf1 = Buffer.from(str); //默认 utf-8 的编码方式
var str1 = buf1.toString("base64"); //【加密】：转化为 base64 的编码方式
console.log(str1); //dXNlck5hbWU6amluc2hpeXVuIHB3ZDogMTIzNA==